Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • asdocx | reg1 template for reporting regression results of biomedical research

    For asdocx users!
    In the recent update of asdocx, I have added reg1 template to the asdocx package. You can read this page https://fintechprofessor.com/asdocx/...-epidemiology/ for more details . A short summary is presented here.

    The reg1 template

    The reg1 template is an asdocx package that creates regression table commonly found in biomedical research papers. It is common in the epidemiology research to report odd ratios or risk-ratios and their p-values from logistic regression or other regression models. reg1 template of asdocx makes it extremely easy to build such tables with much needed flexibility.
    The template is free. However, it requires asdocx package. The template file is installed automatically when you install asdocx.

    After installation of the template, you can use the template as shown below.


    Syntax

    Code:
    asdocx reg depvar indepvars, title(text) dec(#) dect(#) ///
           template(reg1) reg_options

    Syntax Details

    The syntax starts with the keywords asdocx. The word reg can be any Stata command for regressions such reg for ols, logistic for logistic regressions, etc.

    The depvar is the dependent or the explained variable .

    The indepvars are all other independent or explanatory variables in the regression model.

    template(reg1) : invokes the reg1 template.

    title(text) : Used to specify the table title.

    dec(#) : To set decimal points for odd-ratios or other estimates, except the p-values. If left empty, three decimal points will be reported.

    dect(#) : To set decimal points of the p-values. If this option is not specified, its values is set equal to dec().

    reg_options : All other regression options such robust, etc.



    A Simple Example
    Code:
    * Load example dataset
    use http://fintechprofessor.com/asdocxAddins/table1.dta, clear
    
    * Make a regression table using the template(reg1) option
    asdocx logistic immigrant logistic immigrant bone_neck bone_fibro ///
           bone_lupus other_anyother  ///
           template(reg1) replace dec(3) dect(4)
    In the above example, immigrant is the dependent variable and all other variables are independent. After comma, option template(reg1) causes asdocx to use the reg1 template. The above code generates a table that looks like this.










    Last edited by Attaullah Shah; 25 Apr 2021, 16:14.
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

  • #2
    Dear Attaullah,

    Thank you for this useful extension of the asdocx reporting options!
    Do you intend to provide more of such templates?
    http://publicationslist.org/eric.melse

    Comment


    • #3
      Dear Professor Melse
      Thanks for your appreciation. In fact, there is one more such template. It is called table1 template. It creates “Table 1”, i.e., patient baseline characteristics table commonly found in biomedical research papers. The template can summarize different types of variables such as continuous and categorical variables in a single table. More details can be found here https://fintechprofessor.com/asdocx/...tients-asdocx/

      More such templates will be available with the passage of time.
      Regards
      --------------------------------------------------
      Attaullah Shah, PhD.
      Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
      FinTechProfessor.com
      https://asdocx.com
      Check out my asdoc program, which sends outputs to MS Word.
      For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

      Comment


      • #4
        asdocx does not work for xtreg and xtgls and many more

        Comment


        • #5
          Pradeep Fonseka
          Your claim is not correct. Here is a reproducible example of using asdocx with xtreg.
          Code:
          . webuse nlswork
                  . xtset idcode
                  . set seed 123
                  . generate county = runiformint(1,3200)
          
          
          * asdocx detailed regression
          
          asdocx xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, be replace
          
          
                            Between regression (regression on group means)
            0 |1                           2             3          4             5           6             7             8
          ----+------------------------------------------------------------------------------------------------------------------
            1 |ln_wage                 Coef.     Std. Err.    t-value       p-value    [95%% Co     Interval]           Sig
          ----+------------------------------------------------------------------------------------------------------------------
            2 |grade                   0.061         0.002      30.37             0       0.057         0.065           ***
            3 |age                     0.032         0.009       3.70             0       0.015         0.049           ***
            4 |age × age               -.001             0      -4.20             0       -.001             0           ***
            5 |ttl_exp                 0.014         0.006       2.45         0.014       0.003         0.025            **
            6 |ttl_exp × ttl_exp       0.001             0       2.25         0.025           0         0.001            **
            7 |tenure                  0.070         0.006      11.50             0       0.058         0.082           ***
            8 |tenure × tenure         -.003             0      -7.02             0       -.004         -.002           ***
            9 | 2                     -0.056         0.011      -5.37             0      -0.077        -0.036           ***
           10 |not_smsa               -0.186         0.011     -16.54             0      -0.208        -0.164           ***
           11 |south                  -0.099          0.01      -9.80             0      -0.119        -0.079           ***
           12 | Constant               0.334         0.121       2.76         0.006       0.097         0.571           ***
           13 | Mean dependent var                   1.677            SD dependent var                                    0.478
           14 | R²                                   0.490            Number of obs                                 28091.000
           15 | F-test                             450.230                Prob > F                                    0.000
           16 | Akaike crit. (AIC)                2142.786            Bayesian crit. (BIC)                                2233.461
          -----------------------------------------------------------------------------------------------------------------------
          
          
          * asdocx nested regression
          
          
            0 |1                                                     2
          ----+-----------------------------------------------------------------------------
            1 |                                                    (1)
            2 |Variables                                          ln_w
          ----+-----------------------------------------------------------------------------
            3 |grade                                          0.061***
            4 |                                                (0.002)
            5 |age                                            0.032***
            6 |                                                (0.009)
            7 |age × age                                      -.001***
            8 |                                                    (0)
            9 |ttl_exp                                         0.014**
           10 |                                                (0.006)
           11 |ttl_exp × ttl~p                                 0.001**
           12 |                                                    (0)
           13 |tenure                                         0.070***
           14 |                                                (0.006)
           15 |tenure × tenure                                -.003***
           16 |                                                    (0)
           17 |2.race                                        -0.056***
           18 |                                                (0.011)
           19 |not_smsa                                      -0.186***
           20 |                                                (0.011)
           21 |south                                         -0.099***
           22 |                                                 (0.01)
           23 |Intercept                                      0.334***
           24 |                                                (0.121)
           25 |Observations                                      28091
           26 |R²                                                0.490
          ----------------------------------------------------------------------------------
          Notes:  Standard errors are in parentheses. *** p<.01, ** p<.05, * p<.1
          
           . webuse invest2
             xtset company time
          asdocx xtgls invest market stock, panels(hetero) replace nest
                                     Table: Regression results
            0 |1                                                    2
          ----+-----------------------------------------------------------------------------
            1 |                                                   (1)
            2 |Variables                                       invest
          ----+-----------------------------------------------------------------------------
            3 |market                                        0.095***
            4 |                                               (0.007)
            5 |stock                                         0.338***
            6 |                                               (0.030)
            7 |Intercept                                   -36.254***
            8 |                                               (6.124)
            9 |Observations                                       100
          ----------------------------------------------------------------------------------
          Notes:  Standard errors are in parentheses. *** p<.01, ** p<.05, * p<.1
          I also checked and did not find any active asdocx license for the name Pradeep Fonseka . Are you sure you have used asdocx? If you have purchased the license with a different name and you are getting any error, I am always responsive to emails and technical questions, just drop me an email.
          Last edited by Attaullah Shah; 13 May 2024, 12:32.
          Regards
          --------------------------------------------------
          Attaullah Shah, PhD.
          Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
          FinTechProfessor.com
          https://asdocx.com
          Check out my asdoc program, which sends outputs to MS Word.
          For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

          Comment

          Working...
          X